<template>
    <div>
        <div>您好！欢迎使用本系统，现在时间：{{ nowTime }}</div>
    </div>
</template>

<script>
import moment from 'moment';
export default {
    data() {
        return {
            timer: '',
            nowTime: ''
        }
    },
    methods: {
        getTime() {
            this.nowTime = moment().format('YYYY年MM月DD日 HH时mm分ss秒');
        },
    },
    mounted() {
        this.getTime();
        this.timer = setInterval(this.getTime, 1000);
    },
    beforeDestroy() {
        clearInterval(this.timer);
    }
}
</script>

<style lang="scss" scoped>

</style>